import request from '@/utils/request'

export default {
  // 新增
  save(data) {
    return request({
      url: `/baoXiao/add`,
      method: 'post',
      data
    })
  },
  // /baoXiao/edit/{id}
  // 编辑
  edit(data){
    return request({
      url: `/baoXiao/edit/${data.id}`,
      method: 'post',
      data
    })
  },
  // 加班管理
  list(page) {
    return request({
      url: `/baoXiao/index`,
      method: 'get',
      params: { pageIndex: page.index, pageSize: page.size }
    })
  },
  // api/baoXiao/auditList
  // 请假审批列表
  auditList(page) {
    return request({
      url: `/baoXiao/auditList`,
      method: 'get',
      params: { pageIndex: page.index, pageSize: page.size }
    })
  },
  ///api/baoXiao/doAudit/{id}
  // 请假审批
  doAudit(id, data) {
    return request({
      url: `/baoXiao/doAudit/${id}`,
      method: 'post',
      data
    })
  },
  // /baoXiao/doAuditBack/{id}
  // 外出审批-退回
  doAuditBack(id) {
    return request({
      url: `/baoXiao/doAuditBack/${id}`,
      method: 'post'
    })
  },
  getById(id) {
    return request({
      url: `/baoXiao/info/${id}`,
      method: 'get'
    })
  },
  delete(arr) {
    return request({
      url: `/baoXiao/deleteByIds`,
      method: 'delete',
      data: arr
    })
  },
  getFlowList(id) {
    return request({
      url: `/baoXiao/flowList/${id}`,
      method: 'get'
    })
  },

  // qingjia/getliuChengJianKongList
  // 请假流程列表
  auditLists(pageuser) {
    return request({
      url: `/baoXiao/getliuChengJianKongList`,
      method: 'get',
      params: pageuser
    })
  },
  // /baoXiao/stateList
  // 报销状态
  stateList(){
    return request({
      url: `/baoXiao/stateList`,
      method: 'get',
    })
  },
  ///baoXiao/getliuChengJianKongList
  // 流程監控
  getliuChengJianKongList(params){
    return request({
      url: `/baoXiao/getliuChengJianKongList`,
      method: 'get',
      params: params
    })
  },
  // /baoXiao/tongji
  // 统计汇总
  tongji(departmentId,year,month){
    return request({
      url: `/baoXiao/tongji`,
      method: 'get',
      params: {departmentId,year,month},
    })
  },
  ///baoXiao/getListByUid
  // 获取个人的
  getListByUid(userId,year,month,pageIndex,pageSize){
    return request({
      url: `/baoXiao/getListByUid`,
      method: 'get',
      params: {userId,year,month,pageIndex,pageSize},
    })
  }

}
